//
//  ActivitySinglton.h
//  UI12豆瓣大项目
//
//  Created by 李奇 on 15/11/3.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Activity.h"
#import "User.h"
@interface ActivitySinglton : NSObject

+(instancetype)shareDataBaseSingleton;

-(void)openDB;

//  收藏表

-(void)createCollectionTable;

-(void)insertCollectionTable:(Activity *)activity;

-(void)deleteCollection:(NSString *)title;

-(void)dropCollectionTable;

-(NSMutableArray *)selectAllCollection;

-(Activity *)selectCollectionWithTitle:(NSString *)title;

-(NSMutableArray *)selectCollectionWithName:(NSString *)name;
//  缓存表

-(void)createActivityTable;

-(void)insertActivityTable:(Activity *)activity;

-(void)dropActivityTable;

-(NSMutableArray *)selectAllActivity;

-(Activity *)selectActivityWithTitle:(NSString *)title;

//用户

-(void)createUserTable;

-(void)insertUser:(User *)user;

-(void)updateUser:(User *)user name:(NSString *)name;

-(void)deleteUser:(NSString *)name;

-(NSMutableArray *)selectUser;

-(void)dropUserTable;

-(User *)selectUserWithTitle:(NSString *)name;
@end
